package com.blockmeta.bbs;
import android.app.Activity
import android.content.Context
import com.blockmeta.bbs.activity.ShareActivity
import com.blockmeta.bbs.immodule.activity.ImCarrierActivity
import com.blockmeta.bbs.immodule.activity.ImPersonalMsgActivity
import com.blockmeta.bbs.immodule.activity.MyAllTodoActivity
import com.blockmeta.bbs.immodule.activity.chat.UUChatActivity
import com.blockmeta.bbs.minemodule.activity.*
import com.blockmeta.bbs.overallserviceapplication.activity.login.LoginAccountActivity
import com.blockmeta.bbs.overallserviceapplication.activity.login.LoginPhoneActivity
import com.blockmeta.bbs.overallserviceapplication.activity.login.RegisterAccountActivity
import com.blockmeta.bbs.overallserviceapplication.web.WebActivity
import com.hellobike.flutter.thrio.module.ModuleIntentBuilder
import com.hellobike.flutter.thrio.module.ModuleRouteObserver
import com.hellobike.flutter.thrio.module.ThrioModule
import com.hellobike.flutter.thrio.navigator.IntentBuilder

public object FlutterModule : ThrioModule(), ModuleIntentBuilder, ModuleRouteObserver {



    override fun onModuleInit(context: Context) {
        navigatorLogEnabled = true
//        multiEngineEnabled = true
    }

    override fun onIntentBuilderRegister(context: Context) {
        registerIntentBuilder("/native/LoginAccountActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return LoginAccountActivity::class.java
            }
        })
        registerIntentBuilder("/native/LoginPhoneActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return LoginPhoneActivity::class.java
            }
        })
        registerIntentBuilder("/native/RegisterAccountActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return RegisterAccountActivity::class.java
            }
        })
        registerIntentBuilder("/native/WebActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return WebActivity::class.java
            }
        })
        registerIntentBuilder("/native/ShareActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return ShareActivity::class.java
            }
        })
//        registerIntentBuilder("/native/LoginAccountActivity", object : IntentBuilder {
//            override fun getActivityClz(): Class<out Activity> {
//                return LoginAccountActivity::class.java
//            }
//        })
        registerIntentBuilder("/native/ImCarrierActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return ImCarrierActivity::class.java
            }
        })
        registerIntentBuilder("/native/UUChatActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return UUChatActivity::class.java
            }
        })
        registerIntentBuilder("/native/MyAllTodoActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return MyAllTodoActivity::class.java
            }
        })
        registerIntentBuilder("/native/ImPersonalMsgActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return ImPersonalMsgActivity::class.java
            }
        })
        registerIntentBuilder("/native/SettingActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return SettingActivity::class.java
            }
        })
        registerIntentBuilder("/native/MineSettingActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return MineSettingActivity::class.java
            }
        })
        registerIntentBuilder("/native/FeedbackActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return FeedbackActivity::class.java
            }
        })
        registerIntentBuilder("/native/HtmlInviteActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return HtmlInviteActivity::class.java
            }
        })
        registerIntentBuilder("/native/ContactUsActivity", object : IntentBuilder {
            override fun getActivityClz(): Class<out Activity> {
                return ContactUsActivity::class.java
            }
        })

    }

//    override fun onJsonSerializerRegister(context: Context) {
////        registerJsonSerializer({ people -> people.toJson() }, People::class.java)
//    }
//
//    override fun onJsonDeserializerRegister(context: Context) {
////        registerJsonDeserializer({ json -> People(json) }, People::class.java)
//    }
}